home *** CD-ROM | disk | FTP | other *** search
/ Nebula 1 / Nebula One.iso / Utilities / Workspace / aa_Intel_Only / TimeShift / TimeShift.pkg / TimeShift.post_install < prev    next >
Encoding:
Text File  |  1995-12-03  |  1.4 KB  |  69 lines

  1. #!/bin/sh
  2.  
  3. echo Checking status of reboot and shutdown.
  4.  
  5. PKG_Path=$1
  6. ASK=$PKG_Path/ask
  7. ADD=$PKG_Path/ADDTO.rc
  8. Targets="reboot halt"
  9. Location=$2
  10. TimeShift=$Location/usr/etc/timeshift
  11. RC=$Location/etc/rc
  12.  
  13. if [ ! -f $TimeShift ]
  14. then    echo $TimeShift not installed!
  15.     echo Installation cannot be performed.
  16.     echo Check Logfile
  17.     exit 1
  18. fi
  19.  
  20. status=0
  21. for Target in $Targets
  22. do
  23.     File=$Location/usr/etc/$Target
  24.     if [ -f $File ]
  25.     then    if /usr/ucb/what $File | grep -s 'Berkeley'
  26.         then    echo $File real
  27.             if mv $File $File.real
  28.             then    echo Moved $File to $File.real
  29.                 echo Linking $TimeShift $File
  30.                 ln $TimeShift $File
  31.             else    echo "Could not rename $File"
  32.                 echo Installation aborted. >&2
  33.                 exit 1
  34.             fi
  35.         else echo $Target fake
  36.             echo Removing potentially older version of $File
  37.             rm $File
  38.             echo Linking $TimeShift $File
  39.             ln $TimeShift $File
  40.         fi
  41.     else    echo $File not present >&2
  42.         status=1
  43.     fi
  44. done
  45.  
  46. $ASK 'Should I modify you /etc/rc file?
  47. If you decline you will have to add the hooks yourself.' "Do Nothing" "Modify /etc/rc"
  48.  
  49. if [ $? -eq 1 ]
  50. then    echo "Remember to add the contents of ADDTO.rc to an rc file."
  51.     exit 0
  52. fi;
  53.  
  54. if grep timeshift:: $RC
  55. then    echo 'Timeshift was already installed.'
  56.     echo 'Not changing /etc/rc'
  57.     exit 0
  58. fi
  59.  
  60. rm -f $RC.pre_timeshift
  61. cp -p $RC $RC.pre_timeshift
  62.  
  63. chmod +w $RC
  64. ed $RC << %EOF%
  65. /Configure kern-loaded drivers/-1r $ADD
  66. w
  67. %EOF%
  68. chmod -w $RC
  69.